<%-- 
    Document   : header
    Created on : Nov 24, 2012, 4:06:54 PM
    Author     : HongDC
--%>

<%@page import="bookstore.bean.LoginBean"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
<header>
    <div class="logo"></div>
    <div class="nav-bar">
        <div class="accStt">
        <% if (session.getAttribute("USER") != null) {%>
            Welcome <%=((LoginBean) session.getAttribute("USER")).getUsername()%> |
            <a href="javascript:void()" onclick="logout()">Logout</a>
            <input type="hidden" name="userType" class="userType" value="<%=((LoginBean) session.getAttribute("USER")).getType()%>">
        <%} else {%>
            <a href="javascript:void()" onclick="toggleDialog('#dAccount')">Login</a>
        <%}%>
        </div>
        <div class="dialog account row" id="dAccount">
            <div class="close" onclick="toggleDialog('#dAccount')">Close</div>
            <div class="col">
                <h3>Login</h3>
                <form id="login">
                    <table>
                        <tr>
                            <td><input name="username" type="text" required pattern="^[a-zA-Z0-9_]*$" placeholder="Username"></td>
                        </tr>
                        <tr>
                            <td>
                                <input name="password" type="password" required pattern="^([a-zA-Z0-9]{6,10})$" placeholder="Password">
                                <input name="action" value="Login" type="submit" class="inline">
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
    </div>
    <div class="menu">
        <ul>
            <li class="active"><a href="">Admin</a></li>
            <li><a href="../">Home</a></li>
        </ul>
    </div>
    <div class="tool-bar">
        <div class="line"></div>
    </div>
</header>